<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/11/12
 * Time: 17:28
 */

namespace app\admin\model\Video;


use think\Model;

class VideoUserRelationModel extends Model
{
    /**
     * 数据表名
     * @var string
     */
    protected $name = "video_user_relation";

    /**
     * 根据条件查询多条
     * @param $where
     * @return array
     * @throws
     */
    public static function getVideoGoodsRelationWhereMore($where)
    {
        $list =self::where($where)->select()->toArray();
        return $list;
    }

    /**
     * 统计
     * @param $where
     * @return int
     */
    public static function getVideoGoodsRelationCountWhere($where)
    {
        $count = self::where($where)->count();
        return $count;
    }

    /**
     * 批量添加
     * @param $data
     * @return int
     */
    public static function addVideoRelation($data)
    {
        $flag = self::insertAll($data);
        return $flag;
    }

    /**
     * 删除
     * @param $where
     * @return int
     * @throws
     */
    public static function delVideoGoodsRelationWhere($where)
    {
        $flag = self::where($where)->delete();
        return $flag;
    }
}